package No1_100.No51_60.LengthofLastWord_58;

public class Solution {
    public int lengthOfLastWord(String s) {
    	int length = 0;
        for (int i = 0; i < s.length(); i++) {
			char b = s.charAt(i);
			if (b == ' '&& s.charAt(i+1) != '\0') {
				length = 0;
			}
			else {
				length++;
			}
		}
    	
    	return length;
    }
}
